package pay.config;//package com.taxation.web.project.pay.config;
//
//import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
//import com.taxation.web.project.pay.enums.PayOrderStatusRespEnum;
//import com.taxation.web.project.pay.module.PayOrderDO;
//import com.taxation.web.project.pay.module.order.vo.PayOrderExportReqVO;
//import com.taxation.web.project.pay.service.PayOrderService;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.scheduling.annotation.Async;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Component;
//
//import javax.annotation.Resource;
//import java.util.List;
//
///**
// * @author 王伟羽
// * @program: shuiwunew
// * @description:
// * @create: 2024/12/18
// */
//@Component
//@Slf4j
//public class PayCancelJob {
//
//    @Resource
//    private PayOrderService payOrderService;
//
//    /**
//     * 暂时每五秒执行一次定时任务扫描
//     * @return
//     * @throws Exception
//     */
//    @Scheduled(cron = "*/10 * * * * ?")
//    public String cancelExecute() throws Exception {
//        PayOrderExportReqVO reqVO = new PayOrderExportReqVO();
//        reqVO.setStatus(PayOrderStatusRespEnum.WAITING.getStatus());
//        List<PayOrderDO> orderList = payOrderService.getOrderListOne(reqVO);
//        log.info("要取消的订单数量："+orderList.size());
//        if(CollectionUtils.isNotEmpty(orderList)){
//            for (PayOrderDO payOrderDO : orderList) {
//                payOrderService.expireOrder(payOrderDO);
//            }
//        }
//        return "执行了定时任务";
//    }
//}
